package com.kedi.healthcenter.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.kedi.healthcenter.service.HealthFoodService;

/**
 * 
 * @Description: 长者健康模块
 * @author: dw
 * @date: 2019 2019年7月27日 下午11:14:56
 */
@RestController
public class HealthFoodController {
	@Autowired
	HealthFoodService healthFoodService;

	/**
	 * @Description: 查询全部床位信息
	 */
	@RequestMapping("/oldfoods")
	@ResponseBody
	public List<Map<String, Object>> oldFoods(@RequestParam int puserid, int total_page, int limit) {
		if (puserid != 0&&total_page != 0&&limit != 0) {
			int page = (total_page - 1) * limit;
			return healthFoodService.oldFoods(puserid, page, limit);
		}else {
			return null;
		}
	}
}
